home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 3.3 KB | 121 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWPictur.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWPICTUR_H
- #define FWPICTUR_H
-
- #ifndef FWGRREF_H
- #include "FWGrRef.h"
- #endif
-
- #ifndef SLPICTUR_H
- #include "SLPictur.h"
- #endif
-
- #ifndef FWGC_H
- #include "FWGC.h"
- #endif
-
- //========================================================================================
- // Forward Class Declarations
- //========================================================================================
-
- class FW_CPictureContext;
- class FW_PResourceFile;
- class FW_CWritableStream;
- class FW_CReadableStream;
-
- //========================================================================================
- // class FW_CPicture
- //========================================================================================
-
- class FW_CPicture : public FW_TGrRefPtr<FW_HPicture>
- {
- public:
- FW_DECLARE_AUTO(FW_CPicture)
-
- FW_CPicture();
- ~FW_CPicture();
-
- FW_CPicture(FW_PlatformPict platformPict);
- FW_CPicture(FW_PResourceFile& resourceFile, FW_ResourceID resourceID);
- FW_CPicture(FW_CReadableStream& stream);
-
- FW_CPicture(const FW_CPicture& other);
- FW_CPicture& operator=(const FW_CPicture& other);
-
- FW_CPicture Copy() const;
-
- friend FW_CWritableStream& operator << (FW_CWritableStream& stream, const FW_CPicture& picture);
- friend FW_CReadableStream& operator >> (FW_CReadableStream& stream, FW_CPicture& picture);
-
- // ----- Delegation
-
- FW_Boolean IsEqual(const FW_CPicture& picture) const
- { return FW_PrivPicture_IsEqual(fRep, picture.fRep); }
-
- void GetPictBounds(FW_SRect& bounds) const
- { FW_PrivPicture_GetPictBounds(fRep, bounds); }
-
- void GetPictBounds(FW_SGraphicContext& gc, FW_SRect& bounds) const;
-
- FW_PlatformPict GetPlatformPict() const
- { return FW_PrivPicture_GetPlatformPict(fRep); }
-
- FW_Boolean IsPlatformPictOrphan() const
- { return FW_PrivPicture_IsPlatformPictOrphan(fRep); }
-
- FW_PlatformPict OrphanPlatformPict() const
- { return FW_PrivPicture_OrphanPlatformPict(fRep); }
-
- void SetPlatformPict(FW_PlatformPict newPict);
-
- void AdoptPlatformPict(FW_PlatformPict newPict);
-
- #ifdef FW_BUILD_MAC
- void MacLock()
- { FW_FailOnError(FW_PrivPicture_MacLock(fRep)); }
-
- void MacUnlock()
- { FW_FailOnError(FW_PrivPicture_MacUnlock(fRep)); }
- #endif
- };
-
- //========================================================================================
- // class FW_CPictureContext
- //========================================================================================
-
- class FW_CPictureContext : public FW_CGraphicContext
- {
- public:
- FW_DECLARE_AUTO(FW_CPictureContext)
- public:
- FW_CPictureContext(Environment* ev,
- FW_CPicture& picture,
- FW_Fixed xSize,
- FW_Fixed ySize);
- // Size is in 72dpi
- virtual ~FW_CPictureContext();
-
- virtual void Reset();
-
- protected:
- ODShape* PrivAcquireClipShape(Environment* ev);
-
- private:
- FW_CPicture& fPicture; // A reference because will modify the ref-cnt pointer
- FW_HGDevice fGraphicDevice;
-
- #ifdef FW_BUILD_MAC
- PicHandle fMacPictHandle;
- #endif
- };
-
- #endif
-